/** 
用户组
 **/
package com.cd2cd.code_template.controller;

import com.cd2cd.code_template.configuration.authority.AuthControl;
import com.cd2cd.code_template.configuration.constants.AuthTypeEnum;
import com.cd2cd.code_template.service.SysGroupService;
import com.cd2cd.code_template.vo.BaseRes;
import com.cd2cd.code_template.vo.PageData;
import com.cd2cd.code_template.vo.SysGroupVo;
import java.util.List;
import javax.annotation.Resource;
import javax.annotation.Title;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("sys-group")
@AuthControl(name = "用户组管理",type = AuthTypeEnum.Backend,routePath = "/system-group/page")
public class SysGroupController {


    @Resource
    private SysGroupService sysGroupService;

    /**
     * @gen_891_lwl
     * 用户组列表
     * 用户组列表
     * @param sysGroupVo
    **/
    @Title("用户组列表")
    @ResponseBody
    @RequestMapping(value="/list", method=RequestMethod.GET)
    public BaseRes<List<SysGroupVo>> getSysGroupList(SysGroupVo sysGroupVo) {
        return sysGroupService.getSysGroupList(sysGroupVo);
    }

    /**
     * @gen_892_lwl
     * 添加用户组
     * 添加用户组
     * @param sysGroupVo
    **/
    @Title("添加用户组")
    @ResponseBody
    @RequestMapping(value="info", method=RequestMethod.POST)
    public BaseRes<String> addGroup(@RequestBody SysGroupVo sysGroupVo, BindingResult bindingResult) {
        return sysGroupService.addGroup(sysGroupVo);
    }

    /**
     * @gen_893_lwl
     * 修改用户组
     * 修改用户组
     * @param sysGroupVo
    **/
    @Title("修改用户组")
    @ResponseBody
    @RequestMapping(value="info", method=RequestMethod.PUT)
    public BaseRes<String> updateGroup(@RequestBody SysGroupVo sysGroupVo, BindingResult bindingResult) {
        return sysGroupService.updateGroup(sysGroupVo);
    }

    /**
     * @gen_894_lwl
     * 删除用户组
     * 删除用户组
     * @param sysGroupVo
    **/
    @Title("删除用户组")
    @ResponseBody
    @RequestMapping(value="info", method=RequestMethod.DELETE)
    public BaseRes<String> delGroup(@RequestBody SysGroupVo sysGroupVo, BindingResult bindingResult) {
        return sysGroupService.delGroup(sysGroupVo);
    }

    /**
     * @gen_895_lwl
     * 用户组详情
     * 用户组详情
     * @param sysGroupVo
    **/
    @Title("用户组详情")
    @ResponseBody
    @RequestMapping(value="info", method=RequestMethod.GET)
    public BaseRes<SysGroupVo> groupDetail(SysGroupVo sysGroupVo) {
        return sysGroupService.groupDetail(sysGroupVo);
    }


}